package models

import (
	"github.com/goravel/framework/database/orm"
	"github.com/goravel/framework/support/carbon"
	. "goravel/app/models/common"
)

type Devicestate struct {
	orm.Model
	DeviceID    string          `gorm:"column:device_id;" form:"device_id" json:"device_id"`
	State       int             `gorm:"column:state;comment:设备状态,1上线，2下线" form:"state" json:"state"`
	StateAt     carbon.DateTime `gorm:"column:state_at;comment:设备状态时间" form:"state_at" json:"state_at"`
	Coordinates CoordRes        `gorm:"column:coordinates;type:geometry;comment:坐标" form:"coordinates" json:"coordinates"`
	Device      Device          `gorm:"references:Code"` //关联devices表中的Code
}
